//
//  SMBTabViewController.swift
//  ShareMusic
//
//  Created by 胡岩 on 16/5/3.
//  Copyright © 2016年 胡岩. All rights reserved.
//

import UIKit

class SMBTabViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        self.tabBar.tintColor = UIColor.primaryColor()
        self.view.backgroundColor = UIColor.whiteColor()
        self.tabBar.backgroundColor = UIColor.whiteColor()
        let singerNav:SMBNavigationController = SMBNavigationController.init(rootViewController: SingerViewController())
        let rankNav:SMBNavigationController = SMBNavigationController.init(rootViewController: RankViewController())
        let sortNav:SMBNavigationController = SMBNavigationController.init(rootViewController: SortViewController())
        
        
        self.addTab("歌手", icon: "歌手", controller: singerNav)
        self.addTab("分类", icon: "排行榜", controller: rankNav)
        self.addTab("功能", icon: "类别", controller: sortNav)
        self.tabBar.shadowImage = UIImage.init()
        self.tabBar.backgroundImage = UIImage.init()
        self.tabBar.translucent = false
    }

    func addTab(title:String, icon:String, controller:UIViewController)  {
        controller.title = title
        controller.tabBarItem.image = UIImage(named: icon)
        self.addChildViewController(controller)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
